import React from 'react'
// import Login from '../views/login'
const User = React.lazy(() => import('../views/user')) 
const Index = React.lazy(() => import('../views/index')) 
const Add = React.lazy(() => import('../views/add')) 

const Login = React.lazy(() => import('../views/login'));
const Layout = React.lazy(() => import('../views/layout'));

export interface IRoute {
	path: string
	element?: React.FC
	children?: IRoute[]
	navagite?: string,
	meta?: {
		title?: string
		hidden?: boolean
	}
}

export const dynamicRoutes: IRoute[] = [{
	path: '/',
	element: Index,
	meta: {
		title: '首页'
	}
}, {
	path: '/add',
	element: Add,
	meta: {
		title: '添加'
	}
}, {
	path: '/user',
	element: User,
	meta: {
		title: '用户'
	}
}]


const routes: IRoute[] = [{
	path: '/login',
	element: Login
}, {
	path: '/',
	element: Layout,
	children: dynamicRoutes
}]


export default routes